home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
fido
/
fz104.lha
/
rexx
/
UX.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1992-06-01
|
3KB
|
108 lines
/*
UX.rexx - Universal extract script
revision 2.1, 23-Dec-91 23:32:21, Peer Hasselmeyer
(Thanks to Robert Williamson for the suggestion of
looking for the deepest archive signature first)
revision 2.0, 20-Aug-91 18:14:08, Peer Hasselmeyer
Supports: Arc, Zoo, LhArc, LHA, Zip, Arj
---------------------- Configuration Section ------------------------- */
packer.arc.x = "PKxArc"
packer.arc.l = "PKxArc -v"
packer.arc.a = "Arc a"
packer.arc.t = "PKxArc -t"
packer.zoo.x = "zoo x"
packer.zoo.l = "zoo l"
packer.zoo.a = "zoo a"
packer.zoo.t = "zoo t"
packer.lharc.x = "lha x"
packer.lharc.l = "lha l"
packer.lharc.a = "lha a"
packer.lharc.t = "lha t"
/* packer.lha.x = "lha x"
* packer.lha.l = "lha l"
* packer.lha.a = "lha a"
* packer.lha.t = "lha t"
*/
packer.zip.x = "unzip x"
packer.zip.l = "unzip v"
packer.zip.a = "zip a"
packer.zip.t = "unzip t"
packer.arj.x = "unarj x"
packer.arj.l = "unarj l"
packer.arj.a = ""
packer.arj.t = "unarj t"
/*----------------------------------------------------------------------*/
parse arg option archive flist
upper option
select
when option = "V" then option = "L"
when option = "L" then option = "L"
when option = "E" then option = "X"
when option = "X" then option = "X"
when option = "A" then option = "A"
when option = "T" then option = "T"
otherwise do
say "Usage: UX <command> <archive> [<list of files>]"
say " command may be one of the following:"
say " V,L : list contents of archive"
say " E,X : extract files from archive"
say " A : add files to archive"
say " T : test files in archive"
exit 1
end
end
if ~open(file, archive, r) then do
say 'Couldn''t access archive "' || archive || '" !'
say
exit 20
end
readin = readch(file, 6)
call close file
if length(readin) < 6 then do
say 'Archive "' || archive || '" is too short !'
say
exit 20
end
select
when left(readin,3) = "ZOO" then method = "ZOO"
/* when substr(readin,3,4) = "-lh5" then method = "LHA" */
when substr(readin,3,3) = "-lh" then method = "LHARC"
when left(readin,2) = "PK" then method = "ZIP"
when left(readin,2) = "60ea"x then method = "ARJ"
when left(readin,1) = "1a"x then method = "ARC"
otherwise do
say 'Can''t handle archive "' || archive || '" !'
say
exit 20
end
end
if packer.method.option = "" then do
say "Can't do that !"
say
exit 20
end
address command packer.method.option archive flist
exit rc